<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <title>{{config('business.admin_page_title')}} | 用户登录</title>
    <!-- Tell the browser to be responsive to screen width -->
    <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
    <!-- Bootstrap 3.3.7 -->
    <link rel="stylesheet" href="/AdminLTE-2.4.2/dist/bootstrap/css/bootstrap.min.css">
    <!-- Font Awesome -->
    <link rel="stylesheet" href="/AdminLTE-2.4.2/dist/css/font-awesome.min.css">
    <!-- Ionicons -->
    <link rel="stylesheet" href="/AdminLTE-2.4.2/dist/css/ionicons.min.css">
    <!-- Theme style -->
    <link rel="stylesheet" href="/AdminLTE-2.4.2/dist/css/AdminLTE.min.css">
    <link rel="stylesheet" href="/lib/jquery.validation/1.14.0/validation.css">
    <!-- iCheck -->
    {{--<link rel="stylesheet" href="/AdminLTE-2.4.2/plugins/iCheck/square/blue.css">--}}

    <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
    <![endif]-->

    <!-- Google Font -->
    <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
    <style>
        .img-captcha{
            width: 107px;
            height: 34px;
        }
        .login-page{
            background: #4a4c50;
            height: auto;
        }
        .login-box{
            margin: 0 auto;
        }
        .login-logo{
            font-size: 21px;
            color:white;
        }
        .login-title{
            margin: 10% auto 20px;
            text-align: center;
            font-size: 21px;
            color:white;
        }
    </style>
</head>
<body class="hold-transition login-page">
<div class="login-title" style="">
    {{config('business.admin_name')}}
</div>
<div class="login-box">
    <!-- /.login-logo -->
    <div class="login-box-body" style="border-radius: 4px;">
        <p class="login-box-msg">用户登录</p>

        <form action="/login" method="post" id="login-form">
            {{ csrf_field() }}
            <div class="form-group has-feedback {{$errors->has('username')?'has-error':''}}">
                <input type="text" class="form-control" value="{{ old('username') }}"  name="username" placeholder="用户名">
                <span class="glyphicon glyphicon-user form-control-feedback"></span>
                @if($errors->has('username'))
                    <label class="control-label" for="inputError1">{{$errors->first('username')}}</label>
                @endif
            </div>
            <div class="form-group has-feedback {{$errors->has('pwd')?'has-error':''}}">
                <input type="password" class="form-control" value="{{ old('pwd') }}" name="pwd" placeholder="密码">
                <span class="glyphicon glyphicon-lock form-control-feedback"></span>
                @if($errors->has('pwd'))
                    <label class="control-label" for="inputError1">{{$errors->first('pwd')}}</label>
                @endif
            </div>
            {{--<div class="form-group has-feedback" style="display: flex;justify-content: space-between;">--}}
                {{--<input type="text" class="form-control" name="code" value="{{ old('code') }}" placeholder="验证码" style="width: 60%;">--}}
                {{--<img class="img-captcha" src="/login_captcha" onclick="this.src='login_captcha?'+ Math.random()" title="点击刷新">--}}
            {{--</div>--}}
            <div class="row">
                <div class="col-xs-8">
                    <div class="checkbox icheck">
                        <a href="#" class="forgetpwd">忘记密码</a><br>
                    </div>
                </div>
                <!-- /.col -->
                <div class="col-xs-4">
                    <input type="submit" class="btn btn-primary btn-block btn-flat" value="登录">
                </div>
                <!-- /.col -->
            </div>
            <div class="row">
                {{--@if (count($errors) > 0)--}}
                {{--<div class="callout callout-danger" style="margin-bottom: 0px;">--}}
                    {{--@foreach ($errors->all() as $error)--}}
                        {{--<p>{{ $error }}</p>--}}
                    {{--@endforeach--}}
                {{--</div>--}}
                {{--@endif--}}

                @if (session('myerror'))
                    <div class="callout callout-danger" style="margin-bottom: 0px;">
                        {{ session('myerror') }}
                    </div>
                @endif

            </div>
        </form>
    </div>
    <!-- /.login-box-body -->
</div>
<!-- /.login-box -->

<!-- jQuery 3 -->
<script src="/AdminLTE-2.4.2/dist/js/jquery.min.js"></script>
<!-- Bootstrap 3.3.7 -->
<script src="/AdminLTE-2.4.2/dist/js/bootstrap.min.js"></script>

<script type="text/javascript" src="/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="/lib/layer/2.4/layer.js"></script>
<script >
    $(function(){
        $('.forgetpwd').click(function () {
            layer.alert('请联系管理员进行密码修改')
        });
        
        $("#login-form").validate({
            rules: {
                username: {
                    required: true,
                    minlength: 2
                },
                pwd: {
                    required: true,
                    minlength: 5
                }
            },
            messages: {
                username: {
                    required: "请输入用户名",
                    minlength: "用户名必需由两个字母组成",
                    maxlength: '用户名不能超过50个字符'
                },
                pwd: {
                    required: "请输入密码",
                    minlength: "密码长度不能小于 6 个字母",
                    maxlenght: "密码不能超过20个字符"
                }
            },
            errorPlacement: function(error, element) {
                error.appendTo(element.parent());
            }
        })
    })
</script>

</body>
</html>
